﻿using Internal.KuiHuaBaoDian.Services.Audio;
using UnityEngine;

namespace KuiHuaBaoDian.Services.Audio {

    public interface IAudioMixer {

        IAudioMixer Parent { get; }

        IAudioModifier Modifier { get; }

        int FinalVolume { get; }
    }

    public abstract class KHBD_AudioMixer : ScriptableObject, IAudioMixer, IAudioMixerInternal {

        protected KHBD_AudioMixer() : base() { }

        [SerializeField]
        private KHBD_AudioMixer m_Parent;
        public IAudioMixer Parent => m_Parent;

        [SerializeField]
        private KHBD_AudioModifier m_Modifier = new();
        public IAudioModifier Modifier => m_Modifier;

        public int FinalVolume => m_Modifier.Volume + (m_Parent == null ? 0 : m_Parent.FinalVolume);
    }
}

namespace Internal.KuiHuaBaoDian.Services.Audio {

    public interface IAudioMixerInternal {
    }
}